https://leetcode.cn/problems/teemo-attacking/description/
class Solution {
public:
    int findPoisonedDuration(vector<int>& t, int d) {
        int ret=d;
        int diff=0;
        for(int i=1;i<t.size();i++)
        {
            diff=t[i]-t[i-1];
            if(diff>=d)
                ret+=d;
            else
                ret+=diff;
        }
        return ret;
    }
};